import React from 'react'
import Link from 'next/link'

export default class extends React.Component {
  static async getInitialProps({ req }) {
    const userAgent = req ? req.headers['user-agent'] : navigator.userAgent
    console.log("首次加载在服务端", userAgent)
    return { userAgent }
  }
  render() {
    return (
      <div>
        <h3> This is a user center page! </h3>
        <Link href="/" passHref>
            <a>返回</a>
        </Link>
      </div>
    )
  }
}